package com.formen.ndk;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;

public class NFCTest extends Fragment implements OnClickListener{

	ImageView p3_bt1;
	ImageView p3_bt2;


	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		View view = inflater.inflate(R.layout.p3, container, false);

		p3_bt1 = (ImageView) view.findViewById(R.id.p3_bt1);
		p3_bt2 = (ImageView) view.findViewById(R.id.p3_bt2);
		p3_bt1.setOnClickListener(this);
		p3_bt2.setOnClickListener(this);

		return view;
	}

	public void onClick(View v) {

		switch (v.getId()) {

		case R.id.p3_bt1:
/*
			// Create new fragment and transaction
			Fragment newFragment = new NFCSend();
			FragmentTransaction transaction = getFragmentManager().beginTransaction();

			//effect
			transaction.setCustomAnimations(R.anim.fade_in,R.anim.fade_out);
			
			// Replace whatever is in the fragment_container view with this fragment,
			// and add the transaction to the back stack
			transaction.replace(R.id.ll_fragment, newFragment);
			
			// Setting Depth
			//transaction.addToBackStack(null);
			
			//transaction.remove(this);
			
			// Commit the transaction
			transaction.commit();
			*/
			
			Intent i = new Intent(getActivity(), NFCSend.class);
			 startActivity(i);
			
			break;
		case R.id.p3_bt2:
			/*
			// Create new fragment and transaction
						newFragment = new NFCReceive();
						transaction = getFragmentManager().beginTransaction();

						//effect
						transaction.setCustomAnimations(R.anim.fade_in,R.anim.fade_out);
						
						// Replace whatever is in the fragment_container view with this fragment,
						// and add the transaction to the back stack
						transaction.replace(R.id.ll_fragment, newFragment);
						
						// Setting Depth
						//transaction.addToBackStack(null);
						
						//transaction.remove(this);
						
						// Commit the transaction
						transaction.commit();
						*/
			Intent i2 = new Intent(getActivity(), NFCReceive.class);
			 startActivity(i2);
			break;

		}

	}
}